{% set type = config.sort_type|default(null) %}
{% set articles = data('LatestArticles',{'count':config.count, type:config.sort_type}) %}
<div class="es-box news-side">
  <h2>{{ config.title|default(config.defaultTitle) }}</h2>
  {% if articles %}
  <ul>
    {% for article in articles %}
      {% if article %}
        <li>
          <a href="{{ path('article_detail', {id:article.id}) }}"> {{ article.title|plain_text(15) }} </a>
          <span class="pull-right">{{ article.updatedTime|date('y-m-d') }} </span>
        </li>
      
      {% endif %}
    {% endfor %}
  </ul>
  {% else %}
         <div class="empty">还没有设置资讯</div>
  {% endif %}
</div>
